
#ifndef etl_dir_h
#define etl_dir_h

#include "etl_base.h"
#include "etl_string.h"

#ifndef WIN32
#define PS "/"
#else
#define PS "\\"
#endif

namespace etl
{

class etl_dir : public etl::etl_base<etl::etl_string>
{
public:
    etl_dir( const char* glob );

    etl_dir( const etl_dir& obj );

    virtual ~etl_dir();

    etl_dir& operator = ( const etl_dir& obj );

    int open_dir( const char* glob );

    bool is_dir( const char* path );

    bool is_reg( const char* path );

    virtual int clear();
    virtual int iter_begin();
    virtual int iter_end();
    virtual int iter_next();
    virtual int iter_prev();
    virtual etl::etl_string* iter_data();
    virtual bool iter_valid();

private:
    etl_dir& copy( const etl_dir& obj );

    int get_file_names( const char* path, const char* glob );

    etl::etl_list<etl::etl_string> names;
};

}

#endif
